<template>
  <div class="base-node" :class="type.toLowerCase()">
    <div class="node-header">
      <div class="title">{{ title }}</div>
      <div class="type-badge">{{ type }}</div>
    </div>
    <div class="node-body">
      <slot></slot>
    </div>
  </div>
</template>

<script setup>
defineProps({
  title: {
    type: String,
    required: true
  },
  type: {
    type: String,
    required: true
  }
})
</script>

<style scoped>
.base-node {
  background: #2a2a2a;
  border-radius: 8px;
  color: #ffffff;
  min-width: 300px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.node-header {
  background: #383838;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title {
  font-weight: bold;
  font-size: 14px;
}

.type-badge {
  font-size: 12px;
  padding: 2px 6px;
  background: #4a4a4a;
  border-radius: 4px;
  color: #aaa;
}

.node-body {
  padding: 12px;
}

/* 输入字段样式 */
.input-field {
  margin: 8px 0;
}

.input-field label {
  display: block;
  color: #aaa;
  font-size: 12px;
  margin-bottom: 4px;
}

.input-value {
  background: #383838;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
}

/* 连接点样式 */
.connection-point {
  display: flex;
  align-items: center;
  margin: 4px 0;
}

.connection-point::before {
  content: '';
  width: 10px;
  height: 10px;
  background: #666;
  border-radius: 50%;
  margin-right: 8px;
}

/* 不同类型节点的主题色 */
.cliptencode .type-badge { background: #7B61FF; }
.ksampler .type-badge { background: #42b883; }
.loadimage .type-badge { background: #FF6B6B; }
.saveimage .type-badge { background: #4ECDC4; }
.vaedecode .type-badge { background: #FFB900; }
.vaeencode .type-badge { background: #FF9F1C; }
.checkpointloadersimple .type-badge { background: #45B7D1; }
</style> 